package pl.hexar.action;

import javax.naming.Context;
import org.jboss.seam.annotations.async.Asynchronous;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.async.Duration;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.faces.Renderer;

@Name("asynchronousMailProcessor")
@AutoCreate
public class AsynchronousMailProcessor {

    @Asynchronous
    public void scheduleSend(TmpUserHome tmpUserHome) {
        try {
            Contexts.getEventContext().set("tmpUserHome", tmpUserHome);
            Renderer.instance().render("/emails/regmail.xhtml");
        } catch (Exception e) {
        }
    }
}